package(default_visibility = ["//:__subpackages__"])

licenses(["notice"])

cc_library(
    name = "hpke_decrypt",
    srcs = ["hpke_decrypt.cc"],
    hdrs = ["hpke_decrypt.h"],
    include_prefix = "tink/hybrid/internal",
    tags = ["requires_boringcrypto_update"],
    visibility = [
        "//:__subpackages__",
        "//objc:__subpackages__",
    ],
    deps = [
        ":hpke_decrypt_boringssl",
        ":hpke_key_boringssl",
        "//:hybrid_decrypt",
        "//internal:ec_util",
        "//proto:hpke_cc_proto",
        "//subtle:common_enums",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "hpke_decrypt_boringssl",
    srcs = ["hpke_decrypt_boringssl.cc"],
    hdrs = ["hpke_decrypt_boringssl.h"],
    include_prefix = "tink/hybrid/internal",
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_key_boringssl",
        ":hpke_util_boringssl",
        "//proto:hpke_cc_proto",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "hpke_encrypt",
    srcs = ["hpke_encrypt.cc"],
    hdrs = ["hpke_encrypt.h"],
    include_prefix = "tink/hybrid/internal",
    tags = ["requires_boringcrypto_update"],
    visibility = [
        "//:__subpackages__",
        "//objc:__subpackages__",
    ],
    deps = [
        ":hpke_encrypt_boringssl",
        "//:hybrid_encrypt",
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "hpke_encrypt_boringssl",
    srcs = ["hpke_encrypt_boringssl.cc"],
    hdrs = ["hpke_encrypt_boringssl.h"],
    include_prefix = "tink/hybrid/internal",
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_util_boringssl",
        "//proto:hpke_cc_proto",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "hpke_key_boringssl",
    srcs = ["hpke_key_boringssl.cc"],
    hdrs = ["hpke_key_boringssl.h"],
    include_prefix = "tink/hybrid/internal",
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_util_boringssl",
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
    ],
)

cc_library(
    name = "hpke_key_manager_util",
    srcs = ["hpke_key_manager_util.cc"],
    hdrs = ["hpke_key_manager_util.h"],
    include_prefix = "tink/hybrid/internal",
    deps = [
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:validation",
        "@com_google_absl//absl/status",
    ],
)

cc_library(
    name = "hpke_private_key_manager",
    srcs = ["hpke_private_key_manager.cc"],
    hdrs = ["hpke_private_key_manager.h"],
    include_prefix = "tink/hybrid/internal",
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_decrypt",
        ":hpke_key_manager_util",
        "//:core/key_type_manager",
        "//:core/private_key_type_manager",
        "//:hybrid_decrypt",
        "//:key_manager",
        "//internal:ec_util",
        "//proto:hpke_cc_proto",
        "//proto:tink_cc_proto",
        "//util:constants",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/status",
    ],
)

cc_library(
    name = "hpke_public_key_manager",
    srcs = ["hpke_public_key_manager.cc"],
    hdrs = ["hpke_public_key_manager.h"],
    include_prefix = "tink/hybrid/internal",
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_encrypt",
        ":hpke_key_manager_util",
        "//:core/key_type_manager",
        "//:hybrid_encrypt",
        "//:key_manager",
        "//proto:hpke_cc_proto",
        "//proto:tink_cc_proto",
        "//util:constants",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "hpke_test_util",
    srcs = ["hpke_test_util.cc"],
    hdrs = ["hpke_test_util.h"],
    include_prefix = "tink/hybrid/internal",
    deps = [
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "hpke_util_boringssl",
    srcs = ["hpke_util_boringssl.cc"],
    hdrs = ["hpke_util_boringssl.h"],
    include_prefix = "tink/hybrid/internal",
    tags = ["requires_boringcrypto_update"],
    deps = [
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

# tests

cc_test(
    name = "hpke_decrypt_boringssl_test",
    size = "small",
    srcs = ["hpke_decrypt_boringssl_test.cc"],
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_decrypt_boringssl",
        ":hpke_test_util",
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "hpke_decrypt_test",
    size = "small",
    srcs = ["hpke_decrypt_test.cc"],
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_decrypt",
        ":hpke_encrypt",
        ":hpke_test_util",
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "hpke_encrypt_boringssl_test",
    size = "small",
    srcs = ["hpke_encrypt_boringssl_test.cc"],
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_encrypt_boringssl",
        ":hpke_test_util",
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "hpke_encrypt_test",
    size = "small",
    srcs = ["hpke_encrypt_test.cc"],
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_encrypt",
        ":hpke_test_util",
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "hpke_key_boringssl_test",
    size = "small",
    srcs = ["hpke_key_boringssl_test.cc"],
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_key_boringssl",
        ":hpke_test_util",
        "//proto:hpke_cc_proto",
        "//util:status",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "hpke_key_manager_util_test",
    size = "small",
    srcs = ["hpke_key_manager_util_test.cc"],
    deps = [
        ":hpke_key_manager_util",
        ":hpke_test_util",
        "//util:status",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "hpke_private_key_manager_test",
    size = "small",
    srcs = ["hpke_private_key_manager_test.cc"],
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_encrypt",
        ":hpke_private_key_manager",
        "//:hybrid_encrypt",
        "//proto:hpke_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:hybrid_test_util",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "hpke_public_key_manager_test",
    size = "small",
    srcs = ["hpke_public_key_manager_test.cc"],
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_public_key_manager",
        ":hpke_test_util",
        "//proto:hpke_cc_proto",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "hpke_util_boringssl_test",
    size = "small",
    srcs = ["hpke_util_boringssl_test.cc"],
    tags = ["requires_boringcrypto_update"],
    deps = [
        ":hpke_test_util",
        ":hpke_util_boringssl",
        "//proto:hpke_cc_proto",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_googletest//:gtest_main",
    ],
)
#include "third_party/absl/status/status.h"
